<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<!--框架必需start-->
		<script type="text/javascript" src="../../libs/js/jquery.js"></script>
		<script type="text/javascript" src="../../libs/js/language/cn.js"></script>
		<script type="text/javascript" src="../../libs/js/framework.js"></script>
		<link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" id="skin" prePath="../../" />
		<link rel="stylesheet" type="text/css" id="customSkin" />
		<!--框架必需end-->
	</head>

	
	<body>
		<div class="page_content">
			<div class="groupTitle"><span>示例说明</span></div>
			轻量级的信息反馈组件，在顶部居中显示，并自动消失。请用它代替alert提示框和操作的结果反馈
			<div class="height_15"></div>
			<div class="groupTitle"><span>1、基本使用</span></div>
			<input type="button" value="打开普通提示" onclick="showToast1()" class="default">
			<input type="button" value="打开成功提示" onclick="showToast2()" class="default">
			<input type="button" value="打开警告提示" onclick="showToast3()" class="default">
			<input type="button" value="打开错误提示" onclick="showToast4()" class="default">

			<div class="groupTitle"><span>2、自定义持续时间</span></div>
			
			<input type="button" value="1秒关闭" onclick="showToast5(1000)" class="default">
			
			
			<div class="groupTitle"><span>3、添加关闭按钮</span></div>
			<input type="button" value="点击打开" onclick="showToast6()" class="default">

			<div class="groupTitle"><span>4、外部关闭</span></div>
			<input type="button" value="点击打开" onclick="showToast7()" class="default">
			<input type="button" value="点击关闭" onclick="showToast8()" class="default">


			<!--<div class="groupTitle"><span>5、关闭事件</span></div>
			<input type="button" value="点击打开" onclick="showToast9()">-->
	</div>
	</body>
<script>
		function showToast1(){
			top.Toast('showNoticeToast', '普通提示信息');
		}
		function showToast2(){
			top.Toast('showSuccessToast', '成功提示信息');
		}
		function showToast3(){
			top.Toast('showWarningToast', '警告提示信息');
		}
		function showToast4(){
			top.Toast('showErrorToast', '错误提示信息');
		}

		function showToast5(time){
				top.Toast('showToast', {
    				text     : '提示信息',
    				stayTime : time,
    				type     : 'notice'})
		}
		function showToast6(){
				top.Toast('showToast', {
    				text     : '打开后不自动关闭',
    				sticky   : true,
    				type     : 'notice',
    				closeButton : true 
    				})
		}

		var msg;
		function showToast7(){
				msg=top.Toast('showToast', {
    				text     : '可以由外部控制关闭',
    				sticky   : true,
    				type     : 'notice'})
		}
		function showToast8(){
				top.Toast('removeToast', msg)
		}
		function showToast9(){
				top.Toast('showToast', {
    				text     : '关闭触发事件',
    				sticky   : true,
    				type     : 'notice',
    				close    :function(){
    					top.Dialog.alert("关闭提示触发了事件")
    				}
    			})
		}
	</script>
</html>